package com.jida.hadoop.mr.join;
 

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
 
import java.io.IOException;
 
 
public class DriverDxProMatch {
    public static void main(String[] args) throws IOException, ClassNotFoundException, InterruptedException {
        Configuration conf = new Configuration();
        Job job = Job.getInstance(conf,"DxProMatch");
        /*job.setGroupingComparatorClass(ComparatorDPM.class);
        job.setPartitionerClass(DPMPartitioner.class);*/
 
        Path input1 = new Path("file:///D:/测试数据/dx/02.DxFileMatch/part-m-00*");
        Path input2 = new Path("file:///D:/测试数据//dx//配置数据/t_dx_product_msg_addr.txt");
        Path[] inputs = new Path[]{input1,input2};
 
        job.setMapperClass(MapperDxProMatch.class);
        job.setMapOutputKeyClass(Text.class);
        job.setMapOutputValueClass(Text.class);
 
        job.setReducerClass(ReducerDxProMatch.class);
        job.setOutputKeyClass(Text.class);
        job.setOutputValueClass(NullWritable.class);
 
        FileInputFormat.setInputPaths(job,inputs);
        FileOutputFormat.setOutputPath(job,new Path("file:///D://测试数据//dx/06.DxProMatch"));
        System.exit(job.waitForCompletion(true)?0:1);
 
    }
}
